<html>

<head>
    <meta charset="utf-8">
    <title> 支付宝配置信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/shop/static/css/headpic.css" media="all" />
    <link rel="stylesheet" href="/shop/static/layui/css/layui.css" media="all" type="text/css">
    <link rel="stylesheet" href="/shop/static/css/public.css" media="all" type="text/css"> </head>

<body class="childrenBody">
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
	  <legend>支付宝配置信息</legend>
	</fieldset>
    <form id="infoForm" class="layui-form" lay-filter="example">
        <input type="hidden" name="id" id="id" value="${configure.id!'0'}">
        <div class="layui-col-md6 layui-col-xs12">
            <div class="layui-form-item">
                <label class="layui-form-label">APP_ID</label>
                <div class="layui-input-block">
                    <input type="text" name="appId" lay-verify="required/number" value="${configure.appId!''}" placeholder="请输入APP_ID" class="layui-input realName"> </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">商户私钥</label>
                <div class="layui-input-block">
             		<textarea  placeholder="请输入您的PKCS8格式RSA2私钥" lay-verify="required" name="merchantPrivateKey" class="layui-textarea myself">${configure.merchantPrivateKey!''}</textarea>
                </div>  
            </div>   
            <div class="layui-form-item">
                <label class="layui-form-label">支付宝公钥</label>
                <div class="layui-input-block">
                    <textarea placeholder="请输入支付宝公钥" lay-verify="required" name="alipayPublicKey" class="layui-textarea myself">${configure.alipayPublicKey!''}</textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">支付宝网关</label>
                <div class="layui-input-block">
                    <input type="text" name="gatewayUrl" lay-verify="required" value="${configure.gatewayUrl!''}" placeholder="请输入支付宝网关" class="layui-input realName"> </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">异步路径</label>
                <div class="layui-input-block">
                    <input type="text" name="notifyUrl" lay-verify="required" value="${configure.notifyUrl!''}" placeholder="请输入异步通知路径" class="layui-input realName"> </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">同步路径</label>
                <div class="layui-input-block">
                    <input type="text" name="returnUrl" lay-verify="required" value="${configure.returnUrl!''}" placeholder="请输入异步通知路径" class="layui-input realName"> </div>
            </div>
            
            <div class="layui-form-item">
                <label class="layui-form-label">签名方式</label>
                <div class="layui-input-block">
                    <input type="text" name="signType" lay-verify="required" readonly value="RSA2" placeholder="请输入签名方式" class="layui-input realName"> </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">编码格式</label>
                <div class="layui-input-block">
                    <input type="text" name="charset" lay-verify="required" readonly value="utf-8" placeholder="请输入字符编码格式" class="layui-input realName"> </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">传参形式</label>
                <div class="layui-input-block">
                    <input type="text" name="psaFormat" lay-verify="required" readonly value="JSON" placeholder="请输入传参形式" class="layui-input realName"> </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" type="button"  lay-filter="form">立即提交</button>
                </div>
            </div>
            
        </div>
    </form>
    <script type="text/javascript" src="/shop/static/layui/layui.js" charset="utf-8" ></script>
    <script type="text/javascript" src="/shop/static/js/common/jquery-2.1.0.min.js"></script>
    <script type="text/javascript" src="/shop/static/js/common/ajaxfileupload.js" charset="utf-8" ></script>
    <script type="text/javascript" src="/shop/static/js/common/popup.js"></script>
    <script type="text/javascript">
    layui.use(['form'], function() {
        var form = layui.form,
            layer = layui.layer;
        form.on('submit(form)', function() {
                $.ajax({
                    cache: true,
                    type: "POST",
                    url: "/shop/payment/saveUpZfbConfigure",
                    data: $('#infoForm').serialize(),
                    async: false,
                    error: function(request) {
                        layer.msg('系统错误！');
                    },
                    success: function(data) {
                        if(data.code = "1") {
                            layer.msg(data.msg, {
                                time: 1000
                            }, function() { //提示框设定显示1秒
                                location.reload();
                            })
                        } else {
                            layer.msg(data.msg);
                        }
                    }
                });
            })
    });
    </script>
</body>

</html>